<?php
class Smithy_Url_Manipuliation
{

    /**
     * Creates an URL string from the given string.
     *
     * @param string $string
     * @return string
     */
    public static function createUrlString($string)
    {
        $mit = array ('é', 'á', 'ű', 'ú', 'ő', 'í', 'ó', 'ü', 'ö', ' ', "\t", "\n", 'É', 'Á', 'Ű', 'Ú', 'Ő', 'Í', 'Ó', 'Ü', 'Ö');
        $mire = array ('e', 'a', 'u', 'u', 'o', 'i', 'o', 'u', 'o', '-', "-", "-", 'E', 'A', 'U', 'U', 'O', 'I', 'O', 'U', 'O');
        $string = str_replace($mit, $mire, $string);
        $string = preg_replace("%[^a-zA-Z0-9-]%", "", $string);
        return $string;
    }
}
